<template>
	<view>
		<view class="container" v-for="(item,index) in dataList" :key="index">
			<view class="title_box">
				<view class="title">{{item.title}}</view>
			</view>
			<basic-table :columns="item.columns" :data="item.tableData">
				<template #item="{column,scope,index}">
					<view>
						<text style="color: red; font-weight: bold;">{{scope.OriginalPrice}}</text>
					</view>
				</template>
			</basic-table>
		</view>
	</view>

</template>

<script>
	import BasicTable from './components/basic-table/basic-table.vue';
	export default {
		components: {
			BasicTable
		},
		data() {
			return {
				dataList: [{
					title: '文件打印',
					tableData: [],
					columns: [{
							fieldName: 'PapeTrypeName',
							fieldDesc: '规格',
						},
						{
							fieldName: 'PCName',
							fieldDesc: '颜色',
						},
						{
							fieldName: 'PMName',
							fieldDesc: '单双面',
						},
						{
							fieldName: 'OriginalPrice',
							fieldDesc: '价格',
							fieldType: 'slot'
						}
					]
				}, ]


			};
		},
		onLoad() {
			this.getPrice()
		},
		methods: {
			async getPrice() {
				console.log(this.$store.state);
				let id = this.$store.state.storeInfo.ID
				let res = await this.$api.post('PrintedFiles/GetMarkedPrice', {ShopID:id})
				console.log(JSON.stringify(res.data) );
				this.dataList[0].tableData=res.data
			}
		}
	};
</script>

<style>
	page {
		background-color: #f5f6f7;
	}
</style>
<style lang="scss" scoped>
	.title_box {
		margin-bottom: 20rpx;
		border-bottom: 1rpx solid #eeeeee;


		.title {
			font-weight: bold;
			font-size: 36rpx;
			margin-bottom: 20rpx;
		}
	}

	.container {
		margin: 20rpx;
		background-color: #ffffff;
		box-sizing: border-box;
		padding: 20rpx;
		border-radius: 10rpx;
	}
</style>